\begin{center}
	\huge{\textbf{Abstract}}
\end{center}

GCC (GNU Compiler Collection) has been one of the most popular compiler infrastructure for many years. It is used across languages, architectures and operating systems. 
The availability of GCC ports for a large
number of targets stands testimony to the success of the retargeting model of GCC. With a large number of embedded systems now being developed and released for use across
various fields, the process of retargeting GCC assumes importance. To port GCC to a new architecture, a Machine Description(MD) file that has the mapping from 
GCC's intermediate form to the target assembly code is to be written.


Constructing an MD file is a difficult task partly because of its large size, but mainly due to the need to understand the intermediate representations of GCC, 
while simultaneously having a good grasp of the target architecture. Due to these difficulties, the process of writing machine descriptions 
has become an ad hoc one. Developers retargeting GCC tend to copy MD files of machines similar to the target machine and modify them, making the whole process a trial 
and error method.  

In this thesis, we demonstrate that MD files of machines with similar architecture exhibit significant amount of similarities. We have created a tool MDParser, to extract 
RTL patterns from MD files of some known machines. Using this tool we compare the similarity of patterns across machines.
We have further created a framework that can use these extracted patterns and with user intervention, can help in the construction of new RTL templates. 
We also show how this framework can be used to build a tool that can help a developer in the construction of MD files for a new architecture, thus simplifying the 
retargeting process.
